package Utils;
import java.util.ArrayList;

public class Distance {
	public static double distance(ArrayList<Double> v1, ArrayList<Double> v2) {

		double result = 0.0;
		//v1*v2/sqrt(v1*v1)*sqrt(v2*v2)
		//sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
		//(0,1,2) (2,3,5)
		double expSum=0.0;
		for(int i=0;i<v1.size();i++)
		{
		expSum+=(v1.get(i)-v2.get(i))*(v1.get(i)-v2.get(i));
		}
		System.out.println("expSum:"+expSum);
		result=Math.sqrt(expSum);
		return result;
	}

	public static void main(String[] args) {
	}

}
